<template>
  <Dialog v-model="dialogVisible" :title="dialogTitle" width="1000">
    <iframe :src="file" frameborder="0" width="100%" height="100%">
      您的浏览器不支持嵌入式框架，请<a :href="file">点击这里下载PDF文件</a>
    </iframe>
    <template #footer>
      <el-button @click="dialogVisible = false">关 闭</el-button>
    </template>
  </Dialog>
</template>
<script lang="ts" setup>
defineOptions({ name: 'ViewPdf' })
const dialogVisible = ref(false) // 弹窗的是否展示
const dialogTitle = ref('查看') // 弹窗的标题
const file = ref('')
/** 打开弹窗 */
const open = async (data) => {
  dialogVisible.value = true
  file.value = data
}
defineExpose({ open })
</script>
<style scoped>
iframe {
  min-height: 500px;
}
</style>
